package cn.tedu.egmvc2.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AddressController {
    //http://localhost:8080/address/add?receiver=王伟超&address=北京海淀区&email=wangweichao@163.com&mobile=13838384383&tag=公司
    @RequestMapping("address/add")
    @ResponseBody
    public String add(String receiver,String Address,String email,String mobile,String tag){
        System.out.println("收货人："+receiver+",地址："+Address+"邮箱号："+email+",手机号："+mobile+",标签："+tag);
        return "添加完成";
    }
    //http://localhost:8080/address/list
    @RequestMapping("address/list")
    @ResponseBody
    public String list(){
        System.out.println("查询邮寄地址");
        return "查询完成";
    }
    //http://localhost:8080/address/delete?id=1
    @RequestMapping("/address/delete")
    @ResponseBody
    public String delete(Long id){
        System.out.println("删除收货地址编号为："+id);
        return "删除完成";
    }

    //http://localhost:8080/address/update?id=1&receiver=王伟超&address=北京海淀区&email=wangweichao@163.com&mobile=13838384383&tag=公司
    @RequestMapping("/address/update")
    @ResponseBody
    public String update(Long id,String receiver,String address,String email,String mobile,String tag){
        System.out.println("修改编号为："+id+",收货人："+receiver+",地址："+address+",邮箱号："+email+",手机号："+mobile+",标签："+tag);
        return "修改完成";
    }


}
